﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace BGELanguageEditor
{
    public partial class OpenFileForm : Form
    {

        private string[] allFiles;
        private int selectedText;
        public int SelectedText
        {
            get { return selectedText; }
        }

        public OpenFileForm(string[] files)
        {
            InitializeComponent();

            allFiles = files;
            list_txts.DataSource = allFiles;
        }

        private void btn_ok_Click(object sender, EventArgs e)
        {
            if (list_txts.SelectedIndex != -1)
            {
                selectedText = list_txts.SelectedIndex;
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
                this.Close();
            }
        }
    }
}
